<?php
/**
 * @return
 * @author 朱乐斌
 * @date
 */


namespace app\api\validate;

use think\Validate;

class EditNotesValidate extends Validate
{
    // 定义验证规则
    protected $rule = [
        'name' => 'max:10',
        'id_card' => 'sometimes|max:18|min:18',
        'phone' => 'mobile',
        'sex' => '',
        'email' => '|email',
        'address' => '',
        'expertise' => '',
        'content' => '',
    ];

    // 定义验证提示
    protected $message = [
        'name.max' => '姓名不能超过10个字符',
        'id_card.max' => '身份证号不能超过18个字符',
        'id_card.min' => '身份证不能少于18个字符',
        'phone.mobile' => '手机号格式不正确',
        'email.email' => '邮箱格式不正确',
    ];

    // 定义验证场景
    protected $scene = [
        'editNotes' => ['name','id_card','phone','sex','email','address','expertise','content'],
    ];
}